package cn.yeziji.forum.controller;

import cn.yeziji.forum.common.ForumResult;
import cn.yeziji.forum.dao.intf.ForumChatroomDao;
import cn.yeziji.forum.dto.user.UserFocusOrFansListPagingDTO;
import cn.yeziji.forum.service.PrivateChatService;
import cn.yeziji.forum.utils.ForumResultUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 聊天室控制器
 *
 * @author gzkemays
 * @since 2022/3/27 18:50
 */
@RestController
@RequestMapping("/chatroom")
public class ForumChatroomController {
  @Resource ForumChatroomDao chatroomDao;

  @Resource PrivateChatService chatService;

  @GetMapping("/statistic")
  public ForumResult userStatistic() {
    return ForumResultUtils.ok(chatroomDao.getUserStatistic());
  }

  @PostMapping("/private")
  public ForumResult getUserContact(@RequestBody UserFocusOrFansListPagingDTO pagingDTO) {
    return ForumResultUtils.ok(chatService.getUserContact(pagingDTO));
  }
}
